package com.njtoyo.taxi.admin.rest.wrapper.marketing.seckill;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.njtoyo.taxi.admin.handler.common.TimeJsonDeserializer;
import com.njtoyo.taxi.admin.mapper.master.enums.ActivitySeckillRuleRoundUnit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@ApiModel("新增、修改秒杀活动规则")
public class SetRuleWrapper {

    @ApiModelProperty(value = "规则id，新增规则时字段为空")
    private Long ruleId;

    @ApiModelProperty(value = "区域编号")
    private Long regionId;

    @ApiModelProperty(value = "是否覆盖全国")
    private Boolean isCoverAllRegions;

    @NotNull(message = "每轮类型不能为空")
    @ApiModelProperty(value = "每轮类型")
    private ActivitySeckillRuleRoundUnit roundUnit;

    @ApiModelProperty(value = "每轮开始数字，比如round_unit为周，数字为5，则为每周五开始的活动，若round_unit为小时或日，则为null")
    private Long roundStartNumber;

    @ApiModelProperty(value = "每轮结束数字，比如round_unit为周，数字为5，则为每周五结束的活动，若round_unit为小时或日，则为null")
    private Long roundEndNumber;

    @ApiModelProperty(value = "每轮开始的时间，如00：00：00")
    @NotNull(message = "每轮开始的时间")
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date roundStartTime;

    @ApiModelProperty(value = "每轮结束的时间，如23：59：59")
    @NotNull(message = "每轮结束的时间")
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date roundEndTime;

}